<?php


namespace app\api\controller;


use app\common\controller\Api;

class About extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    /**
     * 基础配置
    */
    public function info(){
        $data = model('app\admin\model\about\AboutConfig')->where('id',1)->find();
        if($data){
            $data->hidden(['id']);
        }
        $this->success('请求成功', $data,200);
    }

    /**
     * 获取制度列表
     */
    public function aboutRegimeList(\app\common\model\about\AboutRegimeModel $AboutRegimeModel){
        $data = $AboutRegimeModel->getList();
        $this->result($data['msg'], $data['data'], $data['code']);
    }

    /**
     * 获取制度详情
     */
    public function aboutRegimeDetail(\app\common\model\about\AboutRegimeModel $AboutRegimeModel){
        $id = $this->request->request('id');
        if(empty($id)){
            $this->error('请求参数错误');
        }
        $data = $AboutRegimeModel->getDetail($id);
        $this->result($data['msg'], $data['data'], $data['code']);
    }

}